package com.egdd.video.service.iml;

import com.egdd.video.mapper.SongMapper;
import com.egdd.video.pojo.Song;
import com.egdd.video.service.SongService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: wh
 * @Date: 2021/2/23 14:37
 */

@Service
public class SongServiceImpl implements SongService {
    @Autowired(required = false)
    private SongMapper songMapper;


    @Override
    public List<Song> getSongByCategoryId(Integer id, int page, int pageSize) {
        PageHelper.startPage(page,pageSize);
        return songMapper.listAll();
    }

    @Override
    public int save(Song song) {
        return songMapper.insert(song);
    }
}
